Skip to content

Add warning about sensitive data in Kapa AI chat disclaimer#2155

Open
gmarav05 wants to merge 3 commits intomedic:mainfrom
gmarav05:add-kapa-warning-notice
Open

Add warning about sensitive data in Kapa AI chat disclaimer#2155
gmarav05 wants to merge 3 commits intomedic:mainfrom
gmarav05:add-kapa-warning-notice

Conversation

@gmarav05
Copy link
Copy Markdown
Contributor

Description

This PR adds a warning to prevent users from sharing sensitive information such as PII, PHI, or passwords when using Kapa AI on the docs site.

Fixes #2120

Changes

  • Updated the Kapa AI modal disclaimer to include a clear warning message above the chat interface.
  • Added a warning near the search input to discourage users from entering sensitive data before opening the Kapa search.

Why

There have been cases where users pasted sensitive information like credentials, instance URLs into the Kapa AI chat. This change improves user awareness and helps prevent accidental data exposure.

Screenshots

image

License

The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.

Signed-off-by: Aravind <gmarav005@gmail.com>
@andrablaj andrablaj requested a review from mrjones-plip March 21, 2026 11:54
Copy link
Copy Markdown
Contributor

@mrjones-plip mrjones-plip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great - thanks @gmarav05 ! I was able to spin up your branch locally and when I went to use the "Ask AI" feature, your ⚠️ NOTICE was right there. Very helpful!

Not a blocker, but is it possible to add this same warning to the search modal too? Kapa powers our search, so should have the same warning as "Ask AI":

Image

data-modal-disclaimer="This is a custom LLM for Community Health Toolkit (CHT) with access to all [Documentation](https://docs.communityhealthtoolkit.org), [GitHub Issues and READMEs](https://github.com/medic/cht-core) and the [CHT Forum](https://forum.communityhealthtoolkit.org). Rate the answers to let us know what you think!

⚠️ NOTICE: Do not share any PII, PHI or passwords. Chat logs are archived and accessible by both Medic and Kapa."
data-search-disclaimer="⚠️ NOTICE: Do not share any PII, PHI or passwords. Chat logs are archived and accessible by both Medic and Kapa."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was unable to see where data-search-disclaimer is used. Is this needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it is not used anywhere and I have now removed it. Thanks for pointing it out @mrjones-plip.

data-modal-ask-ai-input-placeholder="Ask me a question about the CHT..."
data-consent-required="true"
data-consent-screen-title="Search and Ask AI are powered by Kapa"
data-consent-screen-body="NOTICE: Do not share any PII, PHI or passwords. Chat logs are archived and accessible by both Medic and Kapa."
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was unable to see where data-consent-screen-body is used. Is this needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out.

I tested data-consent-screen-body, but I wasn't sure about this fix. It was working. But, since issue description asks to add a warning on both search and chat for Kapa.

Copy link
Copy Markdown
Contributor Author

@gmarav05 gmarav05 Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, It pops up like a small consent screen popup that appears before a user can use the AI/search feature. Let me know if you’d like me to add it.

@mrjones-plip
Copy link
Copy Markdown
Contributor

@gmarav05 - any updates on the requested changes?

@gmarav05
Copy link
Copy Markdown
Contributor Author

gmarav05 commented Apr 1, 2026

I am working on it. Sorry for the delay i was unavailable due to college exams. Now i can contribute again. I will let you know when i push changes. @mrjones-plip

@gmarav05
Copy link
Copy Markdown
Contributor Author

gmarav05 commented Apr 1, 2026

hello @mrjones-plip, While testing my disclaimer changes i found another small bug or just font colour error. Currently the ai generated answers on live site (tables) are showing black colour text.

Current Live Site Screenshot


Screenshot 2026-04-01 at 9 51 15 AM


So, I tried to fix this as well and here is how it looks now with the disclaimer for both "Ask AI" and "Search".

Screen.Recording.2026-04-01.at.9.48.04.AM.mov

@gmarav05 gmarav05 requested a review from mrjones-plip April 1, 2026 04:27
Copy link
Copy Markdown
Contributor

@mrjones-plip mrjones-plip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates @gmarav05 ! I'm unable reproduce the dark text on a dark background on Chromium (and FF). You can see my results of the prompt show base tables of cht below.

Since I'm unable to reproduce, and your fix for this involves a lot semi-invasive changes, lets revert these changes and focus on just the warnings for now. Thanks for your concern though!

Image


const SEARCH_NOTICE_ID = 'cht-search-notice';

const NOTICE_TEXT = '⚠️ NOTICE: Do not share any PII, PHI or passwords. Chat logs are archived and accessible by both Medic and Kapa.';
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love that this is reused, minor tweak to make sure it applies to both chat and search:

Suggested change
const NOTICE_TEXT = '⚠️ NOTICE: Do not share any PII, PHI or passwords. Chat logs are archived and accessible by both Medic and Kapa.';
const NOTICE_TEXT = '⚠️ NOTICE: Do not share any PII, PHI or passwords. Queries are archived and accessible by both Medic and Kapa.';

Signed-off-by: Aravind <gmarav005@gmail.com>
@gmarav05
Copy link
Copy Markdown
Contributor Author

gmarav05 commented Apr 2, 2026

Thanks for letting me know @mrjones-plip, I was using chrome and Microsoft Edge without any dark mode extension. It's fine I removed those styles now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add warning about sensitive data being pasted into Kapa.AI

2 participants